#include<bits/stdc++.h>
using namespace std;

int countLatticePoints(vector<vector<int>>& circles) {
	int ans = 0;
	for (int i = 0; i <= 200; i++) {
		for (int j = 0; j <= 200; j++) {
			for (auto &ii : circles) {
				if ((i - ii[0]) * (i - ii[0]) + (j - ii[1]) * (j - ii[1]) <= ii[2]*ii[2]) {
					ans++;
					break;
				}
			}
		}
	}
	return ans;
}

int main() {
	int x, y, z;
	vector<vector<int>> a;
	while (cin >> x >> y >> z && x != -1 && y != -1 && z != -1) {
		a.push_back({x, y, z});
	}
	cout << countLatticePoints(a);
	return 0;
}
